﻿/*
 * Author: Roy Scheefhals
 * 
 * Blob object which holds the information of the blob
 * */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LibraryCS
{
    public class Blob
    {
        //the label given by growing selection
        public int label;

        // the X and Y corner positions of the blob itself
        public int topLeftX = 0, topRightX = 0, bottomLeftX = 0, bottomRightX = 0;
        public int topLeftY = 0, topRightY = 0, bottomLeftY = 0, bottomRightY = 0;

        //the corner positions of the blob
        //This is the coordinates of the bounding box shown in the GUI
        public int maxx = 0, maxy = 0, minx = 0, miny = 0;

        //amount of BLOB pixels
        public int amountOfPixels = 0;

        //by martijn koopman
        public override string ToString() {
            string str = "Blob: label = " + label + "; pixels = " + amountOfPixels + "\n";
            str += "(" + topLeftX + ", " + topLeftY + ") (" + topRightX + ", " + topRightY + ")\n";
            str += "(" + bottomLeftX + ", " + bottomLeftY + ") (" + bottomRightX + ", " + bottomRightY + ")\n";

            return str;
        }
    }
}
